package org.example.controller;

import com.baomidou.mybatisplus.extension.api.R;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.example.service.BookService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author TonySong
 * @date 2024/6/27 0027
 * @time 11:18
 */
@RestController
@RequestMapping("/book")
@Slf4j
public class BookController {

    @Value("${server.port}")
    private Integer port;
    @Resource
    private BookService bookService;

    @GetMapping("/")
    public R getBooks(){
        log.info("------------------------------------->port:{}",port);
        return  R.ok(this.bookService.list());
    }
}
